<?php $__env->startSection('content'); ?>
    <section class="hbox stretch">
        <?php echo $__env->make("back.public.left", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        <aside>
            <section class="vbox">
                <header class="header bg-white b-b clearfix">
                    <form class="talbe-search" method="get" action="<?php echo e(url('admin/function')); ?>">
                        <div class="row m-t-sm">
                            <div class="col-sm-9 m-b-xs">
                                <a role="button" class="btn btn-sm btn-primary sc-opt" href="<?php echo e(url("admin/product/create")); ?>">生成
                                    <i class="glyphicon"></i>
                                </a>
                            </div>
                        </div>
                    </form>
                </header>
                <div class="tc-bgg"></div>

                <div class="tc-dv tc-dv-sc">
                    <p>请输入生成数据：</p>
                    <div class="clearfix">
                        <span>生成数量:</span>
                        <a class="reduce" id="reduce">-</a>
                        <input type="text" name="cardNum" id="cardNum" value="2">
                        <a class="add" id="add">+</a>
                    </div>
                    <p class="opt-btn">
                        <a href="javascript:void(0)" class="qd-btn">确定</a>
                        <a href="javascript:void(0)" class="qx-btn">取消</a>
                    </p>
                </div>
                <section class="scrollable  wrapper w-f">
                    <section class="panel panel-default">
                        <div class="table-responsive">
                            <table class="table table-hover m-b-none entity-view" data-path="/attendance/count/countDetail/id/{0}">
                                <thead>
                                <tr>
                                    <th style="text-align: center;">序号</th>
                                    <th style="text-align: center;">编码</th>
                                    <th style="text-align: center;">门状态</th>
                                    <th style="text-align: center;">有无书</th>
                                    <th style="text-align: center;">生成时间</th>
                                    <th style="text-align: center;">柜门二维码</th>
                                    <th style="text-align: center;">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php $__currentLoopData = $res; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=>$v): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td style="text-align: center;"><?php echo e($limit*($res->currentPage()-1)+$k+1); ?></td>
                                        <td style="text-align: center;"><?php echo e($v->code); ?></td>
                                        <td style="text-align: center;"><?php echo e(\App\Util\doorStatus::getLabel($v->status)); ?></td>
                                        <td style="text-align: center;"><?php echo e(\App\Util\bookDoor::getLabel($v->book_status)); ?></td>
                                        <td style="text-align: center;"><?php echo e(\App\Util\TimeHelper::formatDateTime($v->created_at)); ?></td>
                                        <td style="text-align: center;"><?php echo QrCode::size(168.75)->generate($v->number.$v->code.$v->column); ?></td>
                                        <td style="text-align: center">
                                            <a href="<?php echo e(url('back/shelf/doorBooks/'.$v->id)); ?>" class="label label-success">查看</a>
                                            
                                            
                                            
                                            
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </section>
                    <div style="text-align: center"><?php echo $res->appends($_GET)->render(); ?></div>
                </section>

            </section>
        </aside>
    </section>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('addscript'); ?>
    <script>
        $(function(){
            $(".del").click(function(){
                var url=$(this).attr("data-back");

                layer.confirm('您确定删除吗？', {
                    btn: ['确认','取消'] //按钮
                }, function(){
                    $.ajax({
                        'url':url,
                        'type':"get",
                        'dataType':'json',
                        'success':function(data){
                            if(data.success){
                                layer.alert("删除成功！",function(){
                                    location.reload();
                                });
                            }else{
                                layer.alert(data.msg)
                            }
                        }
                    })
                }, function(){

                })
            })
        });
        //生成弹窗
        $(".sc-opt").click(function(){
            $(".tc-bgg,.tc-dv-sc").show();
            return false;
        });
        //关闭弹窗
        $(".qx-btn,.tc-bgg").click(function(){
            $(".tc-bgg,.tc-dv-sc,.tc-dv-dc").hide();
        });
        //确定生成
        $(".qd-btn").click(function(){
            var num = $("#cardNum").val();
            if(confirm("确认生成吗？")) {
                var index = layer.load(1);
                $.ajax({
                    url: "<?php echo e(url('back/shelf/yieldDoors')); ?>",
                    type: "post",
                    dataType: "json",
                    data: {num: num,sid:"<?php echo e($id); ?>"},
                    success: function (data) {
                        layer.close(index);
                        if (data.success) {
                            window.location.href=location.href;
                        }
                        else {
                            layer.alert(data.msg);
                        }
                    }
                })
            }
        })
    </script>
    <style>
        .clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
        .clearfix{zoom:1;}
        .tc-bgg{
            position: fixed;
            top: 0px;
            left: 0px;
            width: 100%;
            height: 100%;
            background: black;
            opacity: 0.5;
            filter:alpha(opacity=50);
            -moz-opacity:0.5;
            -khtml-opacity: 0.5;
            z-index: 10;
            display: none;
        }
        .tc-dv{
            width: 400px;
            height: 340px;
            position: fixed;
            top: 50%;
            margin-top: -145px;
            left: 50%;
            margin-left: -200px;
            background: white;
            padding: 30px;
            z-index: 11;
            font-size: 16px;
        }
        .tc-dv-sc,.tc-dv-dj,.tc-dv-dc{
            display: none;
        }
        .tc-dv div {
            font-size: 16px;
            margin: 25px 0px;
        }
        .tc-dv div span{
            float: left;
            position: relative;
            top: 7px;
            margin-right: 15px;
        }
        .tc-dv div a{
            text-align: center;
            display: inline-block;
            width: 30px;
            height: 28px;
            cursor: pointer;
            line-height: 28px;
            font-size: 20px;
            color: #999999;
            border: 1px solid #999999;
            background: #f6f6f6;
            margin: 0px;
            padding: 0px;
            float: left;
        }
        .tc-dv div input{
            background: white;
            border-top: 1px solid #999999;
            border-bottom: 1px solid #999999;
            border-left: 0px;
            border-right: 0px;
            min-width: 30px;
            max-width: 70px;
            height: 28px;
            line-height: 28px;
            text-align: center;
            float: left;
        }
        .tc-dv div select{
            height: 28px;
        }
        .tc-dv .opt-btn{
            text-align: center;
        }
        .tc-dv .opt-btn a{
            background: #f2f4f4;
            color: #333333;
            padding: 5px 20px;
            border-radius: 4px;
            margin-right: 10px;
        }
        .tc-dv-dj .qsjsh{
            margin: 20px 0px;
        }
        .tc-dv-dj input{
            width: 100px;
            margin-left: 20px;
            border: 1px solid #e3e3e3;
            height: 25px;
            line-height: 25px;
            padding-left: 5px;
            border-radius: 4px;
        }
        .tc-dv-dj .opt-btn {
            text-align: center;
            margin-top: 25px;
        }
    </style>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('back.adminbase', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>